package com.cj.designpattern.strategy;

/**
 * ClassName: TranficCalculator <br/>
 * Function: 交通工具价格计算器 <br/>
 * date: 2018/04/28 14:28 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public class TranficCalculator {

    private ICalculateStrategy iCalculateStrategy;

    public TranficCalculator(ICalculateStrategy iCalculateStrategy) {
        this.iCalculateStrategy = iCalculateStrategy;
    }

    public int calculatePrice(int km) {
        return iCalculateStrategy.calculatePrice(km);
    }
}
